#ifndef _COMMUNICATION_DEVICE_ELECTRICAL_HEAD
#define _COMMUNICATION_DEVICE_ELECTRICAL_HEAD

#include "communication-device.h"
#include "smart-device-manager.h"
#include <map>

class CommunicationDeviceElectrical : public CommunicationDevice
{
public:
    CommunicationDeviceElectrical(SmartDeviceManager *manager);
    void communication(SmartDeviceNetProtocol &netprotocol, NetCommunication *netobj);
    // bool control(SmartDeviceNetProtocol &netprotocol, NetCommunication *netobj);
    void query(SmartDeviceNetProtocol &netprotocol, NetCommunication *netobj);
    void add(SmartDeviceNetProtocol &netprotocol, NetCommunication *netobj);
    void remove(SmartDeviceNetProtocol &netprotocol, NetCommunication *netobj);
    void open(SmartDeviceNetProtocol &netprotocol, NetCommunication *netobj);
    void close(SmartDeviceNetProtocol &netprotocol, NetCommunication *netobj);
    void replay(NetCommunication *netobj, const string &command, const string &errmsg = "", const string &data = "");

private:
    SmartDeviceManager *smartDeviceManger;
    typedef void (CommunicationDeviceElectrical::*funcation_t)(SmartDeviceNetProtocol &, NetCommunication *);
    map<string, funcation_t> handle;
};

#endif